package com.gy.api.base;

import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
public class RestPage<T>  {

    @ApiModelProperty(value = "第几页")
    private Integer pageNum;
    @ApiModelProperty(value = "每页多少条数据")
    private Integer pageSize;
    @ApiModelProperty(value = "总共有多少条数据")
    private long totalNum;
    @ApiModelProperty(value = "总页数")
    private Integer pages;
    @ApiModelProperty(value = "数据")
    private List<T> list;

    public RestPage(PageInfo page, List<T> list){
        this.pageNum = page.getPageNum();
        this.pageSize =page.getPageSize();
        this.pages =page.getPages();
        this.totalNum = page.getTotal();
        this.list = list;
    }

}
